<?php

use Illuminate\Database\Schema\Blueprint;
use Illuminate\Database\Migrations\Migration;

class CreateOrderOperatorHistoriesTable extends Migration
{
    /**
     * Run the migrations.
     *
     * @return void
     */
    public function up()
    {
        Schema::create('order_operator_histories', function (Blueprint $table) {
            $table->increments('id');

            $table->integer('order_id')->unsigned()->comment('订单 ID')->index();
            $table->string('reason')->comment('操作原因');
            $table->integer('operator_id')->comment('操作者 ID，可能是客户也可能是卖家');
            $table->string('event')->comment('操作事件');
            $table->text('data')->comment('操作具体内容');
            $table->boolean('status')->comment('操作状态');

            $table->timestamps();
        });
    }

    /**
     * Reverse the migrations.
     *
     * @return void
     */
    public function down()
    {
        Schema::drop('order_operator_histories');
    }
}
